﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Watson.Core.Tools;
using ITOMMS.Entity;
using ITOMMS.Business;

namespace ITOMMS.Web.Main
{
    public partial class DirectionsList : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataShow();

                if (SessionHelper.UserRoleGroup != PubEnums.RoleGroup.管理员.ToString())
                {
                    DataControlField colDelete = (DataControlField)this.dgdaoim_sus_plyedr.Columns[4];
                    colDelete.Visible = false;
                }
            }
        }

        private void DataShow()
        {
            tbCustomerNeedToKnowEntity entity = new tbCustomerNeedToKnowEntity();
            AspNetPager1.RecordCount = entity.GetTotalRecords(" 1=1 ");
            this.dgdaoim_sus_plyedr.DataSource = entity.GetAllByQuery(" 1=1 ", "order by id ", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex);
            this.dgdaoim_sus_plyedr.DataBind();
        }


        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            DataShow();
        }

    }
}
